home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 June / EnigmA AMIGA RUN 19 (1997)(G.R. Edizioni)(IT)[!][issue 1997-06][EAR-CD III].iso / recent1 / dvc.lha / DVC / Plugins / DVC.rexx next >
OS/2 REXX Batch file  |  1997-02-27  |  2KB  |  70 lines

  1. /* $VER: DVC.rexx 1.0 (27.2.97) Msi Software
  2.  *
  3.  * This script get the browser file & screen,
  4.  * and get the correct browser address for use with sys:rexxc/rx
  5.  * Then DVC is started with the RX option,
  6.  * a string that holds the rexxaddress and browser command.
  7.  * Currently this script support AWeb/Voyager/IBrowse,
  8.  * but can easily be adapted for other browsers that use REXX.
  9.  * Perhaps even for use with non-WWW programs like FTP etc.
  10.  *
  11.  * (The URL's in DVC's Type 2 lists may be HTTP, FTP, etc, etc.)
  12.  */
  13.  
  14. /* Allow use of result strings */
  15. options results
  16.  
  17. /* Get a list of the current ports */
  18. ports=show('P')||' '
  19.  
  20. /* Get the arguments */
  21. parse arg cmds
  22. parse var cmds file screen
  23.  
  24. IF pos('AWEB',ports)>0 THEN
  25.    DO
  26.       /* Get the active AWeb port */
  27.       parse var ports dummy 'AWEB.' portnr .
  28.       address value 'AWEB.'||portnr
  29.       'GET ACTIVEPORT'
  30.       awebhost=result
  31.       /* Get screenname if no screenname was given */
  32.       if screen='' then do
  33.          'GET SCREEN'
  34.          screen=RESULT
  35.       end
  36.       /* Set the browser port and command for AWeb */
  37.       browsercmd=awebhost' Open'
  38.    END
  39. ELSE
  40.    IF pos('MINDWALKER',ports) THEN
  41.       /* Set the string for Voyager */
  42.       browsercmd='MINDWALKER OpenURL'
  43.    ELSE
  44.       IF pos('VOYAGER',ports) THEN
  45.          /* Set the string for Voyager */
  46.          browsercmd='VOYAGER OpenURL'
  47.       ELSE
  48.          IF pos('IBROWSE',ports) THEN
  49.             /* Set the string for IBrowse */
  50.             browsercmd='IBROWSE GotoURL'
  51.          ELSE
  52.             /* Browser not running, or not supported */
  53.             exit
  54.  
  55. /* As you can see, only 'BrowserPort BrowserCommand' is needed, */
  56. /* DVC will later append the download url to the end of the browsercmd */
  57. /* and send that string to sys:rexxc/rx */
  58.  
  59. /* Strip spaces and quotation marks in front and behind of strings, */
  60. /* this is needed since the script (and DVC) later add "" marks. */
  61. file=strip(file,'B',' ')
  62. screen=strip(screen,'B',' ')
  63. file=strip(file,'B','"')
  64. screen=strip(screen,'B','"')
  65.  
  66. /* Start DVC*/
  67. address command 'DVC 'file' LIST PUB="'screen'" RX="'browsercmd'"'
  68.  
  69. exit
  70.